
enum SIZE {
    //% block="29*29"
    1,
    //% block="58*58"
    2
}

enum LINE {
    //% block="1"
    1,
    //% block="2"
    2,
    //% block="3"
    3,
    //% block="4"
    4
}

enum BTN {
    //% block="A"
    A,
    //% block="B"
    B,
    //% block="A+B"
    AB
}


//% color="#1888e8" iconWidth=50 iconHeight=40
namespace Json {
    //% block="read  Json cont [Content] read string [ReadCont] " blockType="reporter"
    //% Content.shadow="string" 
    //% ReadCont.shadow="string"
    export function Json(parameter: any, block: any) {
        let json = parameter.Content.code;
        let ReadCont = parameter.ReadCont.code;
        Generator.addInclude("Json_01", "#include <Json.h>");
        Generator.addObject("Json_01", "Json", "cn");

        Generator.addCode([`cn.sensor(${json}, ${ReadCont})`, Generator.ORDER_UNARY_POSTFIX]) ；
    }

    //% block="xunhuan read  string Json cont [Content] read string [ReadCont] xu hao [Ex]" blockType="reporter"
    //% Content.shadow="string" 
    //% ReadCont.shadow="string"
    //% Ex.shadow="string"
    export function Json2(parameter: any, block: any) {

        let json = parameter.Content.code;
        let ReadCont = parameter.ReadCont.code;
        let Ex = parameter.Ex.code;
        Generator.addInclude("Json_01", "#include <Json.h>");
        Generator.addObject("Json_01", "Json", "cn");
        Generator.addCode([`cn.myobj(${json}, ${ReadCont}, ${Ex})`, Generator.ORDER_UNARY_POSTFIX])；

    }
    //% block="xunhuan read  int Json cont [Content] read string [ReadCont] xu hao [Ex]" blockType="reporter"
     //% Content.shadow="string" 
    //% ReadCont.shadow="string"
    //% Ex.shadow="number"
    export function Json3(parameter: any, block: any) {
        
        let json = parameter.Content.code;
        let ReadCont = parameter.ReadCont.code;
        let Ex = parameter.Ex.code;
        Generator.addInclude("Json_01", "#include <Json.h>");
        Generator.addObject("Json_01", "Json", "cn");
        Generator.addCode([`cn.latitude(${json}, ${ReadCont}, ${Ex})`, Generator.ORDER_UNARY_POSTFIX])；

    }

     //% block="xunhuan read  int Json cont [Content] read string [ReadCont] xu hao [Ex] zi [Cot]" blockType="reporter"
     //% Content.shadow="string" 
    //% ReadCont.shadow="string"
    //% Ex.shadow="number"
    //% Cot.shadow="string"
    export function Json4(parameter: any, block: any) {
        
        let json = parameter.Content.code;
        let ReadCont = parameter.ReadCont.code;
        let Ex = parameter.Ex.code;
        let Cot = parameter.Cot.code;
        Generator.addInclude("Json_01", "#include <Json.h>");
        Generator.addObject("Json_01", "Json", "cn");
        Generator.addCode([`cn.Xh(${json}, ${ReadCont}, ${Ex}, ${Cot})`, Generator.ORDER_UNARY_POSTFIX])；

    }


}
